<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2015/5/6
 * Time: 15:19
 * 这个类是根据某些特殊情况 个某些某些特殊的模块补贴一些参数 比如对于内容页的 模块 有的需要知道当前是显示哪一个内容  就在这里补充
 * 或者说这个类就是管理来自post和get传来的参数对于模块的影响的----------
 * 哪些模块 除了哪些样式参数 和 共同的参数以外 还需要别的呢
 */
class ModelArg{
    //特殊模块列表
    protected $modellist = array('content01','content02','productlist01','product02','productinfo01',
    'priProductlist04','priGemform01','priKgform01','priKglist10','priKgform02','priKglist08',"priMpnav01","priMplist03");


    /**
     * @param $get
     * @param $post
     * @param $modelName  模块名
     * @param $signName  标签名
     * @return array  用数组的形式返回参数的键值对
     */
    public function parseArgs($get,$post,$modelName,$signName){
        if(in_array($modelName, $this->modellist)){
            return $this->$modelName($get,$post,$signName);
        }
        return null;
    }

    public function content01($get,$post,$signName){
        $pid = $get['pid'];
        return array('pid'=>$pid);
    }

    public function content02($get,$post,$signName){
        $pid = $get['pid'];
        return array('pid'=>$pid);
    }

    public function productlist01($get,$post,$signName){
        $catid = $get['catid'];
        return array( 'catid' => $catid );
    }

    public function product02( $get, $post, $signName ) {
        $catid = $get['catid'];
        return array( 'catid' => $catid );
    }

    public function productinfo01( $get, $post, $signName ) {
        $pdid = $get['pdid'];
        return array( 'pdid' => $pdid );
    }

    public function priProductlist04( $get, $post, $signName ){
        $catid = $get['catid'];
        return array( 'catid' => $catid );
    }

    public function priGemform01($get,$post,$signName){
        return array('post'=>$post);
    }

    public function priKgform01($get,$post,$signName){
        return array('post'=>$post);
    }
    
    public function priKglist10($get,$post,$signName){
        return array('page'=>$get['page']);
    }

    public function priKgform02($get,$post,$signName){
        return array('post'=>$post);
    }

    public function priKglist08( $get, $post, $signName ){
        $catid = $get['catid'];
        return array( 'catid' => $catid );
    }
    
    public function priMpnav01($get,$post,$signName)
    {
    	return array('token'=>$_GET['token'],'menu'=>$_GET['mid']);
    }
    
    public function priMplist03($get,$post,$signName){
    	return array('token'=>$_GET['token'],'menu'=>$_GET['mid']);
    }
}
